package com.my.job.quartz.config;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Configurable
@EnableScheduling
public class ScheduledTasks {


    //十分钟一次
    @Scheduled(fixedRate = 1000 * 60 * 10)
    @Transactional
    public void reportCurrentTime(){
        System.out.println ("Scheduling Tasks Examples: The time is now ");
    }
    //每1分钟执行一次
//    @Scheduled(cron = "0 */1 *  * * * ")
//    public void reportCurrentByCron(){
//
//        System.out.println ("查询修改会员过期用户会员状态" + dateFormat ().format (new Date ()));
//    }


}
